#读取文件

f = open("E:\\py代码\\word.txt", "r", encoding="utf-8")

#读取文件放到 列表中
#方法1

# line = f.read()
# count = line.count("12")
# print(count)

#方法2
count = 0
for line in f:
    line = line.strip() #去除开头和结尾的换行符
    words = line.split(" ")
    for word in words:
        if word == "12":
            count += 1

print(count)